<?php
class Customer_model extends CI_Model{
	
	function __construct() {
        parent::__construct();
    }
    
    public function get_customer($email='', $password=''){
    	$sql = "SELECT * FROM customer WHERE customer_email = '{$email}' AND customer_password = '{$password}'";
    	$query = $this->db->query($sql);
    	if ($query->num_rows > 0){
    		return $query->result_array();
    	}else{
    		return FALSE;
    	}
    }
    
    public function insert($name, $email, $password){
    	$data = array(
		   'customer_email' => $email ,
		   'customer_name' => $name ,
		   'customer_password' => $password
		);
		$query = $this->db->insert('customer', $data); 
    	if ($query){
    		return $this->db->insert_id();
    	}else{
    		return FALSE;
    	}
    }
}

/* End of file customer_model.php */
/* Location: ./application/models/customer_model.php */